package com.ljb.designpatterns.simplefactory;

/**
 * 工厂类
 * Created by ljb on 2018/6/25.
 */
public class ProductFactory {
    public static Product create(String productName){
        Product product = null;
        switch (productName) {
            case "A":
                product = new ProductA();
                break;
            case "B":
                product = new ProductB();
                break;
        }
        return product;
    }
}
